package com.zzk.im.hx.service.impl;

import com.zzk.im.hx.model.HXResponseObject;
import com.zzk.im.hx.model.TalkGroup;
import com.zzk.im.hx.service.HXGroupService;
import com.zzk.im.hx.service.HXHttpService;
import com.zzk.im.tool.Constant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by zzk on 2018/3/11.
 */
@Service
public class HXGroupServiceImpl implements HXGroupService {


    @Autowired
    HXHttpService hxHttpService;


    public HXResponseObject addGroup(TalkGroup talkGroup) throws Exception {

        Map<String, Object> param = new HashMap<String, Object>();
        param.put("groupname", "测试名");
        param.put("desc", "测试描述");
        param.put("public", true);
        param.put("maxusers", 200);
        param.put("approval", true);
        param.put("owner", "kjop77");
        param.put("members",new String[]{"kjop78"});
        return hxHttpService.request(Constant.URL_GROUP, Constant.HTTP_METHOD_POST,
                param, true, HXResponseObject.DATA_GROUP);
    }
}
